package interview.shence;

import java.util.*;


public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        String[] strings = str.split(",");
        int[] nums = new int[strings.length];
        try {
            for (int i = 0; i < strings.length; ++i) {
                nums[i] = Integer.valueOf(strings[i].trim());
            }
        } catch (NumberFormatException exception) {
            return;
        }

        if (nums.length == 0) {
            return;
        }
        if (nums.length == 1) {
            System.out.println(nums[0]);
            return;
        }
        Arrays.sort(nums);
        int len = nums.length;
        int mid = len / 2;
        if (len % 2 == 0) {
            System.out.println((nums[mid] + nums[mid - 1]) / 2);
        } else {
            System.out.println(nums[mid]);
        }
    }
}
